define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'live.live_host/index',
        add_url: 'live.live_host/add',
        edit_url: 'live.live_host/edit',
        delete_url: 'live.live_host/delete',
        export_url: 'live.live_host/export',
        modify_url: 'live.live_host/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'id', title: 'id'},
                    {field: 'name', title: '主播名称'},
                    {field: 'card_num', title: '主播身份证号码',templet:function (res) {
                   return res.card_num.replace(res.card_num.substr(5,8),"*".repeat(8))
            }},
                    {field: 'phone', title: '主播电话'},
                    {field: 'create_time', title: '注册时间'},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});